import time

from playwright.sync_api import sync_playwright
from time import sleep

def testA3Case():
    with sync_playwright() as p:

        browber=p.chromium.launch(headless=False)
        page=browber.new_page()
        page.goto('http://10.59.9.12:7001/')
        page.click('//a[@href="/home/login.html"]')
        dy1 = page.locator('[class="reg-new"]').text_content()
        print(dy1)
        page.fill('input[name="username"]','18620064667')
        page.fill('input[name="password"]','123456')
        time.sleep(10)
        page.click('//a[@class="finish-btn"]')
        time.sleep(5)
        page.click('xpath=/html/body/div[3]/div[2]/ul/li[1]/a')
        page.fill('input[class="search-input"]','非洲之心')
        page.click('input[class="search-input-btn"]')
        page.click('//img[@src="/uploads/images/20250606/af9ef24936d60ea1dfe55120bccc1906.png"]')
        page.click('a[id="buy-cart"]')
        page.click('input[class="radio-select-btn"]')
        page.click('a[id="order-button"]')
        time.sleep(3)